package test.fairway;

import java.util.Date;

public class DateUtil {
	public static long getDurationSeconds(Date expiration) {
		return (expiration.getTime() - new Date().getTime()) / 1000;
	}
	
	public static Date getExpirationDate(long duration) {
		Date expiration = new Date();
		long milliSeconds = expiration.getTime();
		milliSeconds += duration * 1000;
		expiration.setTime(milliSeconds);
		return expiration;
	}
}
